import React, { Component } from 'react'
import '../assets/style/img.less'
import LazyLoad from 'react-lazyload';
import logo from '../assets/images/header.jpg'
export default class Img extends Component {
    render() {
        return (
            <LazyLoad
                // scrollContainer='.category_content'
                className={this.props.className}
                scroll={true}
                offset={0}
                placeholder={<img width="100%" height="100%" src={logo} alt="logo" />}
            >
                <img className={"img_less " }
                    src={this.props.src.indexOf('http') !== -1 ?
                        this.props.src :
                        (this.props.src.indexOf('syc_api') !== -1 ? this.props.src:require('../assets/images/' + this.props.src))}
                        onClick={this.props.onClick}
                    alt={this.props.alt}
                />
            </LazyLoad>
        )
    }
}
